import 'dart:convert';

import 'package:flutter_secure_storage/flutter_secure_storage.dart';

class SecureStorage{

  final storage =  const FlutterSecureStorage();

  static SecureStorage of(){
    return SecureStorage();
  }

  void set(String key, dynamic value){
    storage.write(key: key, value: value);
  }

  Future<String> get(String key) async  {
    return await storage.read(key: key).then((value) => value??'');
  }

  void remove(String key){
    storage.delete(key: key);
  }

  void clear(){
    storage.deleteAll();
  }

}